

<script type="text/javascript" src="/static/js/jquery.Jcrop.js"></script>

<script>
	$(function(){
		var head_img_src = $('#my_true_head_img').attr('src');
		$("#target img","#head_upload_form").attr('src',head_img_src);
		$('.jcrop-preview').attr('src',head_img_src);
		$("#headImgSrc","#head_upload_form").val(head_img_src);
	});
</script>
<div class="row">
        <div class="span12">
            <div class="jc-demo-box">
                <form action="" id="head_upload_form" enctype="multipart/form-data" method="post" >
                <div class="page-header">
                	 <p>编辑头像</p>
                	 <div class="line"></div>
               		 <div id="uploadButtonDiv" class="load_tx com_btn_g">上传图片</div>
               	 	 <div id="uploadingDiv" style="width: 16px;height: 16px;display: none;"><img src="/static/images/loading.gif" style="width: 16px;height: 16px"/></div>
                	 <input type="file" onchange="uploadChangeHead(this)" id="box_upload_head_ipt" name="myfiles" style="margin-top:-50px; opacity:0; position:absolute; height:30px; width:90px;filter:alpha(opacity=0);"/>
                	 <font color="red" id="uploadTipsDiv"></font>
                	 <font style="color:#999;" id="uploadTipsDefDiv">仅支持jpg、jpeg、png，推荐180x180以上，且文件小于1M</font>
                </div><!--page-header-->
            	<div id="target">
            		<img class="bigpic" onload="setImgPosition()"/>
            	</div>


			   <input type="hidden" id="headImgSrc" name="headImgSrc" />
			   <input type="hidden" id="x1" name="x" />
			   <input type="hidden" id="y1" name="y" />
			   <input type="hidden" id="x2" name="x2" />
			   <input type="hidden" id="y2" name="y2" />
			   <input type="hidden" id="w" name="w" />
			   <input type="hidden" id="h" name="h" />
			   <input type="hidden" id="sw" name="sw" />
			   <input type="hidden" id="sh" name="sh" />
			   <input type="hidden" id="zw" name="zw" />
			   <input type="hidden" id="zh" name="zh" />
                </form>
              <div id="preview-pane">
                <div class="preview-container" id="preview-container">
                  <img class="jcrop-preview" />
                </div>
              </div>

              <div class="description">
             	 <p>您上传的头像会自动生成小尺寸头像，请注意头像是否清晰</p>
              </div>

            <div class="tapmodo-footer" >
               <div id="submitDiv" class="com_btn_b" style="display: none" onclick="uploadTrueHead()">确定</div>
               <div class="com_btn_g" onclick="$.modal.close();">关闭</div>
            </div>

            <div class="clearfix"></div>

            </div><!--jc-demo-box-->
        </div><!--span12-->
</div><!--row-->

